Skip to content

Add success flag for addEdge#532

Closed
danielsuh05 wants to merge 1 commit intoZigRazor:masterfrom
danielsuh05:issue-350
Closed

Add success flag for addEdge#532
danielsuh05 wants to merge 1 commit intoZigRazor:masterfrom
danielsuh05:issue-350

Conversation

@danielsuh05
Copy link
Copy Markdown

Fixes Issue #521.

If either std::optionals are not set, return false, else continue normally. Adds this test as well.

@ZigRazor ZigRazor linked an issue Sep 24, 2025 that may be closed by this pull request
@ZigRazor
Copy link
Copy Markdown
Owner

ZigRazor commented Sep 26, 2025

I don't understand your fix, can you explain me?
Thank You

@danielsuh05
Copy link
Copy Markdown
Author

danielsuh05 commented Sep 26, 2025

I don't understand your fix, can you explain me?

Thank You

Sorry maybe I misunderstood the original issue. I thought the problem was when the optional values were not set, thus leading us to not know if the edge is directed or weighted (leading to an error). I didn't really understand where addEdge would ever return false for unsuccessful in any other case. Could you expand on this?

@ZigRazor
Copy link
Copy Markdown
Owner

we could return the boolean flag that is returned by the insert function ( https://en.cppreference.com/w/cpp/container/unordered_map/insert.html ), obviously when it returns false the function does not update the cached adjacency matrix.

@ZigRazor
Copy link
Copy Markdown
Owner

Please, take in consideration also to the Issue #533 , that I have opened just now

@ZigRazor ZigRazor mentioned this pull request Sep 30, 2025
@ZigRazor
Copy link
Copy Markdown
Owner

ZigRazor commented Oct 3, 2025

I close this one, because the #542 have also the correction for issue #521 @danielsuh05

@ZigRazor ZigRazor closed this Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A success flag when addEdge fails would be useful change to this API

2 participants